<template>
  <div class="params-info" v-if="Object.keys(paramInfo).length !== 0">
    <!--table:负责表个数 tr:负责行 td:负责行内信息-->
    <table class="info-sizes"
           v-for="(table,index) in paramInfo.sizes" :key="index">
      <tr v-for="(tr,indey) in table" :key="indey">
        <td v-for="(td,indez) in tr" :key="indez">
          {{ td }}
        </td>
      </tr>
    </table>

    <table class="info-params">
      <!--tr:遍历行 td:展示列-->
      <tr v-for="(line,index) in paramInfo.infos" :key="index">
        <td class="info-key">{{ line.key }}</td>
        <td class="info-value">{{ line.value }}</td>
      </tr>
    </table>

    <div class="info-images" v-if="paramInfo.image.length !== 0">
      <img :src="paramInfo.image" alt="">
    </div>
  </div>
</template>

<script>
import TabControl from '@/components/content/tabControl/TabControl'

export default {
  name: "DetailGoodsParams",
  components: {TabControl},
  props: {
    paramInfo: {
      type: Object,
      default() {
        return {}
      }
    }
  }
}
</script>

<style scoped>
.params-info {
  padding: 20px 15px;
  font-size: 14px;
  border-bottom: 5px solid #f2f5f8;
}

.params-info table {
  width: 100%;
  /*边框合并*/
  border-collapse: collapse;
  line-height: 25px;
}

.params-info table tr {
  height: 42px;
  border-bottom: 1px solid rgba(100, 100, 100, .1);
}

.info-params {
  border-top: 1px solid rgba(0, 0, 0, .1);
}

.info-params .info-key {
  /*当value的数据量比较大的时候, 会挤到key,所以给一个固定的宽度*/
  width: 25%;
}

.info-params .info-value {
  color: var(--color-high-text);
}

.info-images img{
  width: 100%;
}
</style>
